package de.tsystems.dict.model;

import org.hibernate.annotations.GenericGenerator;

import javax.persistence.Cacheable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;

@Entity
@Cacheable
public class Translation implements Identifiable {
    private String id;
    private Word left;
    private Word right;

    @Id
    @GenericGenerator(name = "uuid", strategy = "org.hibernate.id.UUIDHexGenerator")
    @GeneratedValue(generator = "uuid")
    @Column(name = "id", nullable = false, length = 36)
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @ManyToOne(optional = false)
    public Word getLeft() {
        return left;
    }

    public void setLeft(Word left) {
        this.left = left;
    }

    @ManyToOne(optional = false)
    public Word getRight() {
        return right;
    }

    public void setRight(Word right) {
        this.right = right;
    }
}
